<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="product" tagdir="/WEB-INF/tags/product"%>
<%@ taglib prefix="system" tagdir="/WEB-INF/tags/system"%>
<%@ taglib prefix="order" tagdir="/WEB-INF/tags/order"%>
<input type="radio" value="1"  name="deliveryKind"  <c:if test="${(not empty order.shippingMethodId) or (empty order.shippingMethodId and empty order.selfCollectionCentreId)}">checked</c:if>/><fmt:message key="salesOrder.panel.shippingMethod"/>
<c:choose>
	<c:when test="${not empty shippingRateList}">
		<span>
			<select id="shippingRateId" name="shippingRateId">
				<option value=""><fmt:message key="salesOrder.panel.pleaseSelect"/></option>
				<c:forEach items="${shippingRateList}" var="shippingRate">
					<option value="${shippingRate.shippingRateId}" <c:if test="${order.shippingRateId == shippingRate.shippingRateId}">selected</c:if>>${shippingRate.shippingMethod.shippingMethodName}</option>
				</c:forEach>
			</select>
		</span>
	</c:when>
	<c:otherwise>
		<span class="red"><fmt:message key="salesOrder.panel.shippingMethod.avalid.none"/><input type="hidden" id="shippingMethodId" name="shippingMethodId"/></span>
	</c:otherwise>
</c:choose>
<hr/>
<input type="radio" value="2" name="deliveryKind" <c:if test="${not empty order.selfCollectionCentreId}">checked</c:if>/><fmt:message key="salesOrder.panel.selfCollectionCentre"/>&nbsp;&nbsp;
<c:choose>
	<c:when test="${not empty selfCollectionCentreList}">
		<span>
			<select id="selfCollectionCentreId" name="selfCollectionCentreId">
				<option value=""><fmt:message key="salesOrder.panel.pleaseSelect"/></option>
				<c:forEach items="${selfCollectionCentreList}" var="selfCollectionCentre">
					<option value="${selfCollectionCentre.selfCollectionCentreId}" <c:if test="${order.selfCollectionCentreId == selfCollectionCentre.selfCollectionCentreId}">selected</c:if>>${selfCollectionCentre.selfCollectionCentreName}</option>
				</c:forEach>
			</select>
		</span>
	</c:when>
	<c:otherwise>
		<span class="red"><fmt:message key="salesOrder.panel.selfCollectionCentre.avalid.none"/><input type="hidden" id="selfCollectionCentreId" name="selfCollectionCentreId"/></span>
	</c:otherwise>
</c:choose>	
